<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="viewport" content="width=device-width, initial-scale=1.0" />
    <meta charset="UTF-8" />
    <title>需求发布平台</title>
    <!-- 添加Markmap相关库 -->
    <script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
    <script src="https://cdn.jsdelivr.net/npm/markmap-lib@0.15.3/dist/browser/index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/markmap-view@0.15.3/dist/browser/index.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft YaHei", Arial, sans-serif;
            background-color: #f0f2f5;
        }

        /* 导航栏样式 */
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 24px;
            background: #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            z-index: 100;
        }

        .mindmap-placeholder {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 14px;
        }

        .nav-left {
            display: flex;
            gap: 36px;
        }

        .nav-item {
            cursor: pointer;
            color: #666;
            padding: 8px 12px;
            border-radius: 4px;
            transition: all 0.3s;
        }

        .nav-item.active {
            background: #1890ff;
            color: white;
        }

        .nav-item:hover {
            color: #1890ff;
        }

        .nav-item.active:hover {
            background: #40a9ff;
            color: white;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            cursor: pointer;
        }

        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #1890ff;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            border: 2px solid #fff;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            display: inline-block;
            margin-left: 10px;
        }

        .avatar.has-image {
            background-color: transparent;
        }

        .user-dropdown {
            display: none;
            position: absolute;
            top: 50px;
            right: 0;
            background: #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            padding: 16px;
            z-index: 200;
            width: 300px;
        }

        .user-dropdown div {
            margin-bottom: 8px;
        }

        .user-dropdown input {
            width: 100%;
            padding: 8px;
            margin-top: 4px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        .user-dropdown button {
            width: 100%;
            padding: 8px 16px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 8px;
        }

        .user-dropdown button:hover {
            background: #40a9ff;
        }

        .upload-avatar {
            text-align: center;
            margin-top: 8px;
        }

        .upload-avatar img {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            margin-bottom: 8px;
        }

        .upload-avatar a {
            color: #1890ff;
            cursor: pointer;
            text-decoration: none;
        }

        .upload-avatar a:hover {
            text-decoration: underline;
        }

        /* 主容器 */
        .container {
            padding: 24px;
            height: calc(100vh - 64px);
            display: flex;
            flex-direction: column;
        }

        /* 上半部分布局 */
        .top-section {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            min-height: 400px;
        }

        /* 脑图区域 */
        .mind-map {
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .mindmap-container {
            height: calc(100% - 40px);
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: #fafafa;
        }

        .mindmap-placeholder {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 14px;
        }

        /* 需求描述区域 */
        .description {
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }

        .description textarea {
            flex: 1;
            border: none;
            padding: 8px;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
        }

        /* 中间按钮区域 */
        .middle-area {
            height: 60px;
            position: relative;
            margin: 12px 0;
        }

        .create-btn {
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            padding: 12px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
        }

        .create-btn:hover {
            background: #40a9ff;
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
        }

        /* 底部输入区域 */
        .bottom-section {
            flex: 0 0 200px;
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .input-demand {
            width: 100%;
            height: 100%;
            border: none;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
            padding: 8px;
        }

        .upload-btn {
            position: absolute;
            bottom: 16px;
            right: 16px;
            background: #f5f5f5;
            border: 1px solid #d9d9d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .upload-btn:hover {
            background: #1890ff;
            color: white;
            border-color: #1890ff;
        }

        /* 需求维护池样式 */
        .maintenance-container,
        .messages-container {
            display: none;
            height: 100%;
        }

        .left-nav {
            width: 200px;
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .dropdown {
            cursor: pointer;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            position: relative;
        }

        /*.dropdown-content {*/
        /*    max-height: 300px;*/
        /*    overflow-y: auto;*/
        /*    scrollbar-width: thin;*/
        /*    scrollbar-color: #1890ff #f0f0f0;*/
        /*}*/

        /*.dropdown-content::-webkit-scrollbar {*/
        /*    width: 6px;*/
        /*}*/

        /*.dropdown-content::-webkit-scrollbar-track {*/
        /*    background: #f0f0f0;*/
        /*    border-radius: 3px;*/
        /*}*/

        /*.dropdown-content::-webkit-scrollbar-thumb {*/
        /*    background-color: #1890ff;*/
        /*    border-radius: 3px;*/
        /*}*/

        /*.dropdown-content div {*/
        /*    padding: 8px 12px;*/
        /*    cursor: pointer;*/
        /*    transition: all 0.3s;*/
        /*    white-space: nowrap;*/
        /*    overflow: hidden;*/
        /*    text-overflow: ellipsis;*/
        /*}*/

        /* 下拉菜单样式 */
        .dropdown {
            cursor: pointer;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            position: relative;
            background-color: white;
            transition: all 0.2s ease;
            user-select: none;
        }

        .dropdown:hover {
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
        }

        .dropdown-content {
            max-height: 300px;
            overflow-y: auto;
            display: none; /* 默认隐藏 */
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background-color: white;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            border: 1px solid #d9d9d9;
            border-radius: 6px;
            margin-top: 4px;
            animation: dropdownFadeIn 0.2s ease-out;
        }

        @keyframes dropdownFadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 下拉菜单项样式 */
        .dropdown-item {
            padding: 10px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            border-bottom: 1px solid #f0f0f0;
            font-size: 14px;
            color: #333;
        }

        .dropdown-item:last-child {
            border-bottom: none;
        }

        /* 悬停效果 */
        .dropdown-item:hover,
        .dropdown-item.hover {
            background-color: #f5f5f5;
            color: #1890ff;
        }

        /* 选中状态 */
        .dropdown-item.selected {
            background-color: #e6f7ff;
            color: #1890ff;
            font-weight: 500;
            position: relative;
        }

        .dropdown-item.selected::after {
            content: "✓";
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #1890ff;
            font-weight: bold;
        }

        /* 无数据状态 */
        .dropdown-item.no-data {
            color: #999;
            font-style: italic;
            cursor: default;
            background-color: #fafafa;
        }

        .dropdown-item.no-data:hover {
            background-color: #fafafa;
            color: #999;
        }

        /* 错误状态 */
        .dropdown-item.error {
            color: #ff4d4f;
            cursor: default;
            background-color: #fff2f0;
        }

        .dropdown-item.error:hover {
            background-color: #fff2f0;
            color: #ff4d4f;
        }

        /* 滚动条美化 */
        .dropdown-content::-webkit-scrollbar {
            width: 6px;
        }

        .dropdown-content::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .dropdown-content::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        .dropdown-content::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* 下拉按钮样式优化 */
        .dropdown::after {
            content: "▼";
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            color: #666;
            transition: transform 0.2s ease;
        }

        .dropdown:hover::after {
            color: #1890ff;
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .dropdown-content {
                max-height: 200px;
            }

            .dropdown-item {
                padding: 12px;
                font-size: 16px;
            }
        }

        .dropdown-content div:hover {
            background-color: #e6f7ff;
        }

        .left-nav .option {
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: all 0.3s;
        }

        .left-nav .option.active {
            background: #1890ff;
            color: white;
        }

        .left-nav .option:hover {
            background: #e6f7ff;
        }

        .right-content {
            flex: 1;
            padding: 24px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            gap: 24px;
            overflow-y: auto; /* 允许垂直滚动 */
        }

        .right-content .horizontal-layout {
            display: flex;
            gap: 24px;
            flex-wrap: wrap; /* 允许换行 */
        }
        .right-content .overview {
            background: #f0f2f5; /* 更柔和的背景色 */
            border-radius: 8px;
            padding: 24px; /* 增加内边距 */
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 更明显的阴影 */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: #333;
            font-size: 16px;
            transition: all 0.3s;
        }

        .right-content .overview h3 {
            margin-bottom: 16px;
            color: #1890ff; /* 使用主题色 */
            font-weight: bold;
        }

        .right-content .overview:hover {
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); /* 悬停时的阴影效果 */
            transform: translateY(-2px); /* 悬停时的轻微上移效果 */
        }

        .description textarea {
            flex: 1;
            width: 50%;
            padding: 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
        }

        .history-section h3 {
            margin-bottom: 16px;
            color: #333;
            font-size: 16px;
            font-weight: 500;
        }

        .history-item {
            padding: 16px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 12px;
            border: 1px solid #e8e8e8;
        }

        .history-item:last-child {
            margin-bottom: 0;
        }

        .history-item .content {
            margin-bottom: 8px;
            color: #666;
            line-height: 1.5;
        }

        .history-item .content:last-child {
            margin-bottom: 0;
        }

        .history-item .time {
            color: #999;
            font-size: 12px;
            margin-top: 8px;
        }

        .history-item .user {
            color: #1890ff;
            font-weight: 500;
            margin-bottom: 8px;
        }

        .save-btn {
            align-self: flex-end;
            padding: 12px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
        }

        .save-btn:hover {
            background: #40a9ff;
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
        }

        /* 消息部分样式 */
        .comment-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .comment-item {
            margin-bottom: 24px;
            padding: 16px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .comment-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .comment-user {
            font-weight: 500;
            color: #1890ff;
        }

        .comment-time {
            color: #8c8c8c;
            font-size: 12px;
            margin-left: 8px;
            white-space: nowrap;
        }

        .comment-text {
            margin-bottom: 12px;
            line-height: 1.6;
        }

        .replies-container {
            margin-top: 16px;
            margin-left: 48px;
            padding-left: 16px;
            border-left: 2px solid #f0f0f0;
        }

        .reply-item {
            display: flex;
            margin-bottom: 16px;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .reply-avatar {
            width: 32px;
            height: 32px;
            margin-right: 12px;
        }

        .reply-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        .reply-content {
            flex: 1;
        }

        .reply-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }

        .reply-user {
            font-weight: 500;
            color: #1890ff;
            font-size: 14px;
        }

        .reply-time {
            color: #999;
            font-size: 12px;
        }

        .reply-text {
            font-size: 14px;
            line-height: 1.6;
        }

        .toggle-replies {
            margin-top: 8px;
            color: #1890ff;
            cursor: pointer;
            font-size: 14px;
            text-align: center;
        }

        .toggle-replies:hover {
            color: #40a9ff;
        }

        .reply-button {
            color: #1890ff;
            border: none;
            background: none;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 14px;
        }

        .reply-button:hover {
            color: #40a9ff;
        }

        /* 横向并列布局 */
        .horizontal-layout {
            display: flex;
            gap: 24px;
            height: calc(100% - 160px);
            margin: 20px 0;
            min-height: 400px;
        }

        .horizontal-layout .mind-map,
        .horizontal-layout .description {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            height: 100%;
        }

        /*.mindmap-container {*/
        /*    flex: 1;*/
        /*    min-height: 300px;*/
        /*    border: 1px solid #ddd;*/
        /*    border-radius: 4px;*/
        /*    background-color: #fafafa;*/
        /*    overflow: hidden;*/
        /*    position: relative;*/
        /*}*/

        /*.mindmap-container svg {*/
        /*    width: 100%;*/
        /*    height: 100%;*/
        /*    position: absolute;*/
        /*    top: 0;*/
        /*    left: 0;*/
        /*}*/

        /*.mindmap-placeholder {*/
        /*    position: absolute;*/
        /*    top: 50%;*/
        /*    left: 50%;*/
        /*    transform: translate(-50%, -50%);*/
        /*    color: #999;*/
        /*    font-size: 14px;*/
        /*    text-align: center;*/
        /*    width: 100%;*/
        /*    padding: 0 20px;*/
        /*}*/

        .description textarea {
            flex: 1;
            width: 100%;
            padding: 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
            min-height: 300px;
            height: calc(100% - 40px);
        }

        .description textarea:focus {
            outline: none;
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }

        .history-section {
            margin-top: 20px;
            padding: 16px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            max-height: 100px;
            overflow-y: auto;
        }

        /* 优化历史记录滚动条样式 */
        .history-section::-webkit-scrollbar {
            width: 6px;
        }

        .history-section::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }

        .history-section::-webkit-scrollbar-track {
            background-color: transparent;
        }

        .history-item {
            padding: 16px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 12px;
            border: 1px solid #e8e8e8;
        }

        .history-item:last-child {
            margin-bottom: 0;
        }

        .history-item .content {
            margin-bottom: 8px;
            color: #666;
            line-height: 1.5;
        }

        .save-btn {
            margin-top: 20px;
            align-self: flex-end;
            padding: 8px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .save-btn:hover {
            background: #40a9ff;
            box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
        }

        /* 消息容器样式 */
        .messages-container {
            display: none;
            height: calc(100vh - 64px);
            padding: 20px;
            gap: 20px;
            background: #f0f2f5;
        }

        .messages-container.active {
            display: flex;
        }

        .messages-container .left-nav {
            flex: 0 0 280px;
            background: #fff;
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            max-height: calc(100vh - 104px);
            overflow-y: auto;
        }

        .messages-container .right-content {
            flex: 1;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            height: calc(100vh - 104px);
            overflow: hidden;
        }

        .messages-container .demand-details {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .messages-container .demand-name {
            padding: 20px;
            border-bottom: 1px solid #f0f0f0;
            font-size: 18px;
            font-weight: 500;
            flex-shrink: 0;
        }

        .messages-container .message-list {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            background: #fff;
        }

        .messages-container .input-section {
            flex-shrink: 0;
            border-top: 1px solid #f0f0f0;
            background: #fff;
        }

        .messages-container .reply-box {
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .reply-textarea {
            width: 100%;
            min-height: 80px;
            padding: 12px;
            border: 1px solid #d9d9d9;
            border-radius: 8px;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
            transition: all 0.3s;
        }

        .reply-textarea:focus {
            outline: none;
            border-color: #40a9ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }

        .confirm-btn {
            align-self: flex-end;
            padding: 8px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
        }

        .confirm-btn:hover {
            background: #40a9ff;
            box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
        }

        /* 需求列表项样式 */
        .demand-list .demand-item {
            padding: 12px;
            margin-bottom: 8px;
            background: #fafafa;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .demand-list .demand-item span.title {
            flex: 1;
            margin-right: 8px;
        }

        .demand-list .demand-item:hover {
            background: #e6f7ff;
        }

        .demand-list .demand-item.active {
            background: #e6f7ff;
            color: #1890ff;
        }

        .demand-list .demand-item.has-unread {
            font-weight: bold;
        }

        /* 未读消息红点样式 */
        .unread-badge {
            position: absolute;
            top: 50%;
            right: 12px;
            transform: translateY(-50%);
            background: #ff4d4f;
            color: white;
            border-radius: 10px;
            padding: 2px 8px;
            font-size: 12px;
            min-width: 20px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            box-shadow: 0 2px 4px rgba(255, 77, 79, 0.2);
        }

        /* 消息样式 */
        .message-item {
            margin-bottom: 16px;
            padding: 16px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            max-width: 80%;
        }

        .expert-message {
            background: #f0f5ff;
            margin-right: auto;
            border-top-left-radius: 0;
        }

        .user-message {
            background: #f6ffed;
            margin-left: auto;
            border-top-right-radius: 0;
        }

        .message-item .sender {
            font-weight: 500;
            margin-bottom: 8px;
        }

        .expert-message .sender {
            color: #1890ff;
        }

        .user-message .sender {
            color: #52c41a;
            text-align: right;
        }

        .message-item .content {
            color: #333;
            line-height: 1.5;
        }

        .message-item .time {
            color: #999;
            font-size: 12px;
            margin-top: 8px;
            text-align: right;
        }

        .container {
            padding: 24px;
            height: calc(100vh - 64px);
            display: flex;
            flex-direction: column;
        }

        .top-section {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            min-height: 400px;
        }

        .mind-map {
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .description {
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }

        .description textarea {
            flex: 1;
            border: none;
            padding: 8px;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
        }

        .middle-area {
            height: 60px;
            position: relative;
            margin: 12px 0;
        }

        .create-btn {
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            padding: 12px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
        }

        .create-btn:hover {
            background: #40a9ff;
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
        }

        .bottom-section {
            flex: 0 0 200px;
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            margin-top: 24px;
        }

        .input-demand {
            width: 100%;
            height: 100%;
            border: none;
            resize: none;
            font-size: 14px;
            line-height: 1.5;
            padding: 8px;
        }
        .confirmsub-btn {
            position: absolute;
            bottom: 16px;
            left: 16px;
            background: #f5f5f5;
            border: 1px solid #d9d9d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .confirmsub-btn:hover {
            background: #1890ff;
            color: white;
            border-color: #1890ff;
        }
        .upload-btn {
            position: absolute;
            bottom: 16px;
            right: 16px;
            background: #f5f5f5;
            border: 1px solid #d9d9d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .upload-btn:hover {
            background: #1890ff;
            color: white;
            border-color: #1890ff;
        }

        .change-password-container {
            display: none;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: rgba(0, 0, 0, 0.5);
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 300;
        }

        .change-password-form {
            background: #fff;
            padding: 24px;
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
            width: 340px;
        }

        .change-password-form div {
            margin-bottom: 16px;
        }

        .change-password-form input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .change-password-form button {
            width: 100%;
            padding: 10px 16px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 8px;
            font-size: 14px;
        }

        .change-password-form button:hover {
            background: #40a9ff;
        }

        .verification-container {
            display: flex;
            align-items: center;
        }

        .verification-container input {
            flex: 1;
            margin-right: 8px;
        }

        .verification-container button {
            width: auto;
            padding: 10px;
            white-space: nowrap;
        }

        /* 添加通知框样式 */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 16px 24px;
            background: #f6ffed;
            border: 1px solid #b7eb8f;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 1000;
            opacity: 0;
            transform: translateX(100%);
            transition: all 0.3s ease-in-out;
            pointer-events: none;
        }

        .notification.show {
            opacity: 1;
            transform: translateX(0);
            pointer-events: auto;
        }

        .notification .icon {
            color: #52c41a;
            font-size: 20px;
        }

        .notification .message {
            color: #52c41a;
            font-size: 14px;
            font-weight: 500;
        }

        .notification.error {
            background: #fff2f0;
            border-color: #ffccc7;
        }

        .notification.error .icon,
        .notification.error .message {
            color: #ff4d4f;
        }

        /* 评论区样式 */
        .comments-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .comments-scroll-container {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 20px;
        }

        .comment-count {
            padding: 16px 20px;
            font-size: 16px;
            font-weight: 500;
            color: #262626;
            border-bottom: 1px solid #f0f0f0;
            background: #fafafa;
        }

        .total-comments {
            color: #1890ff;
            font-weight: 600;
            margin-left: 4px;
        }

        .comment-item {
            margin: 16px 20px;
            padding: 16px;
            background: #fafafa;
            border-radius: 8px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .comment-header {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .comment-user {
            font-weight: 500;
            color: #1890ff;
            margin-right: auto;
        }

        .comment-text {
            color: #333;
            margin-bottom: 8px;
            line-height: 1.5;
        }

        .comment-actions {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 8px;
        }

        .reply-button {
            background: none;
            border: none;
            color: #1890ff;
            cursor: pointer;
            font-size: 14px;
        }

        .reply-button:hover {
            color: #40a9ff;
        }

        .replies-container {
            margin-left: 52px;
            margin-top: 12px;
        }

        .reply-item {
            display: flex;
            margin-bottom: 12px;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .reply-box {
            margin-top: 12px;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .reply-input-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .reply-textarea {
            width: 100%;
            min-height: 60px;
            padding: 12px;
            border: 1px solid #d9d9d9;
            border-radius: 8px;
            resize: none;
            font-size: 14px;
        }

        .reply-textarea:focus {
            outline: none;
            border-color: #40a9ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }

        .reply-box.main-reply {
            position: sticky;
            bottom: 0;
            background: #fff;
            margin: 0;
            padding: 16px 20px;
            border-top: 1px solid #f0f0f0;
            z-index: 1;
        }

        /* 优化滚动条 */
        .comments-scroll-container::-webkit-scrollbar {
            width: 6px;
        }

        .comments-scroll-container::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }

        .comments-scroll-container::-webkit-scrollbar-track {
            background-color: transparent;
        }

        /* 展开/收起回复按钮 */
        .toggle-replies {
            color: #1890ff;
            cursor: pointer;
            font-size: 14px;
            margin-top: 8px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .toggle-replies:hover {
            color: #40a9ff;
        }

        .toggle-replies i {
            transition: transform 0.3s;
        }

        .toggle-replies.expanded i {
            transform: rotate(180deg);
        }

        /* 确认按钮样式 */
        .confirm-btn {
            align-self: flex-end;
            padding: 8px 24px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
        }

        .confirm-btn:hover {
            background: #40a9ff;
            box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
        }

        /* 需求标题和ID样式 */
        .demand-header {
            padding: 20px;
            border-bottom: 1px solid #f0f0f0;
            background: #fff;
        }

        .demand-name {
            font-size: 18px;
            font-weight: 500;
            color: #262626;
            margin-bottom: 8px;
        }

        .demand-info {
            font-size: 14px;
            color: #595959;
            padding: 4px 8px;
            background: #f5f5f5;
            border-radius: 4px;
            display: inline-block;
        }

        /* 评论区域样式优化 */
        .comments-section {
            background: #fff;
            border-radius: 8px;
            margin-top: 1px;
        }

        .comment-count {
            padding: 16px 20px;
            font-size: 16px;
            font-weight: 500;
            color: #262626;
            border-bottom: 1px solid #f0f0f0;
            background: #fafafa;
        }

        .total-comments {
            color: #1890ff;
            font-weight: 600;
            margin-left: 4px;
        }

        /* 评论项样式优化 */
        .comment-item {
            margin: 16px 20px;
            padding: 16px;
            background: #fafafa;
            border-radius: 8px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .comment-header {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .comment-user {
            font-weight: 500;
            color: #1890ff;
            margin-right: auto;
        }

        /* 评论头像样式 */
        .comment-avatar {
            width: 32px;
            height: 32px;
            margin-right: 12px;
            flex-shrink: 0;
            border-radius: 50%;
            overflow: hidden;
        }

        .comment-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        /* 评论内容布局 */
        .comment-item {
            display: flex;
            margin: 16px 20px;
            padding: 16px;
            background: #fafafa;
            border-radius: 8px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .comment-content {
            flex: 1;
            min-width: 0; /* 防止内容溢出 */
        }

        /* 回复区域头像样式 */
        .reply-avatar {
            width: 24px;
            height: 24px;
            margin-right: 8px;
            flex-shrink: 0;
            border-radius: 50%;
            overflow: hidden;
        }

        .reply-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        /* 回复项布局 */
        .reply-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 12px;
            padding: 12px;
            background: #f0f2f5;
            border-radius: 8px;
        }

        .reply-content {
            flex: 1;
            min-width: 0;
        }

        /* 需求详情页脑图和描述容器样式 */
        .demand-detail .mind-map,
        .demand-detail .description {
            height: 100%;
            overflow: auto;
            background: #fff;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .demand-detail {
            height: calc(100% - 40px);
            min-height: 300px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: #fafafa;
            overflow: auto;
        }

        .demand-detail .description-text {
            height: calc(100% - 40px);
            overflow: auto;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: #fafafa;
        }

        /* 优化滚动条样式 */
        .demand-detail .mind-map::-webkit-scrollbar,
        .demand-detail .description-text::-webkit-scrollbar,
        .demand-detail .mindmap-container::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        .demand-detail .mind-map::-webkit-scrollbar-thumb,
        .demand-detail .description-text::-webkit-scrollbar-thumb,
        .demand-detail .mindmap-container::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }

        .demand-detail .mind-map::-webkit-scrollbar-track,
        .demand-detail .description-text::-webkit-scrollbar-track,
        .demand-detail .mindmap-container::-webkit-scrollbar-track {
            background: transparent;
        }
    </style>
    <style>
        /*历史修改*/
        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            border-bottom: 1px solid #eee;
            background: #fff;
            margin-bottom: 8px;
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .history-info {
            display: flex;
            gap: 16px;
            align-items: center;
        }
        .modifier {
            font-weight: 500;
            color: #2196F3;
        }
        .type {
            color: #666;
        }
        .time {
            color: #999;
            font-size: 0.9em;
        }
        .download-btn {
            padding: 6px 12px;
            border: none;
            background: #f5f5f5;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .download-btn:hover {
            background-color: #e9e9e9;
        }
    </style>
</head>
<body>
<nav class="navbar">
    <div class="nav-left">
        <div class="nav-item active">新建需求</div>
        <div class="nav-item">需求维护池</div>
        <div class="nav-item">消息</div>
    </div>
    <div class="user-info">
        <span>经理</span>
        <span id="userEmail" th:text="${userEmail}"></span>
        <div class="avatar"></div>
        <div class="user-dropdown">
            <div>
                手机号/邮箱：
                <span id="userContact" th:text="${userEmail}"
                >已登录的手机号或邮箱</span
                >
            </div>
            <div class="upload-avatar">
                <input
                        type="file"
                        id="avatarInput"
                        accept="image/*"
                        style="display: none"
                />
                <a href="#" id="uploadAvatarBtn">点击上传头像</a>
            </div>
            <button id="change-password-btn">修改密码</button>
        </div>
    </div>
</nav>

<div class="container">
    <div class="top-section">
        <div class="mind-map">
            <h3 style="margin-bottom: 12px; color: #333">需求脑图</h3>
            <!-- 思维导图容器 -->
            <div id="mindmap-container" class="mindmap-container">
                <div class="mindmap-placeholder">
                    请在右侧输入需求内容，将自动生成思维导图
                </div>
            </div>
        </div>

        <div class="description">
            <h3 style="margin-bottom: 12px; color: #333">需求描述</h3>
            <textarea
                    id="demand-description"
                    placeholder="请输入详细的需求描述..."
            ></textarea>
        </div>
    </div>
    <div class="bottom-section">
        <textarea
                class="input-demand"
                id="input-demand"
                placeholder="输入您的需求内容...（支持Markdown格式）"
        ></textarea>
        <button class="confirmsub-btn" id="confirmsub-btn">⬆️ 确定需求</button>
        <button class="upload-btn">
            <span>📎 上传附件</span>
            <input type="file" hidden multiple />
        </button>
    </div>
    <div class="middle-area">
        <button class="create-btn">创建新需求</button>
    </div>
</div>

<div class="maintenance-container">
    <div class="left-nav">
        <div class="dropdown main-demand-dropdown">
            <span class="dropdown-text">选择已发布的需求</span>
            <div class="dropdown-content">
                <!-- 动态添加需求列表 -->
            </div>
        </div>
        <div class="dropdown sub-demand-dropdown">
            下拉选择子需求
            <div class="dropdown-content">
                <!-- 动态添加子需求列表 -->
            </div>
        </div>
        <div class="option" id="overview-option" style="display: none">
            概览
        </div>
        <div class="option" id="sub-demand-option" style="display: none">
            子需求
        </div>
    </div>
    <div class="right-content">
        <div class="overview">
            <h3 style="margin-bottom: 12px; color: #333">
                子需求名称/某需求的概览：
            </h3>
        </div>

        <div class="horizontal-layout">
            <div class="mind-map">
                <h3 style="margin-bottom: 12px; color: #333">需求脑图</h3>
                <div
                        id="maintenance-mindmap-container-one"
                        class="mindmap-container"
                >
                    <div class="mindmap-placeholder">
                        请在右侧输入需求描述，将自动生成思维导图
                    </div>
                </div>
            </div>

            <div class="description">
                <h3 style="margin-bottom: 12px; color: #333">需求描述</h3>
                <textarea
                        id="demand-description-one"
                        placeholder="请输入详细的需求描述..."
                ></textarea>
            </div>
        </div>

        <div class="history-section">
            <h3 style="margin-bottom: 12px; color: #333">历史修改：</h3>
            <div class="history-item">
                <div class="content">某人修改：</div>
                <div class="content">原内容：<br />...</div>
                <div class="content">修改为：<br />...</div>
            </div>
        </div>

        <button class="save-btn">保存</button>
    </div>
</div>

<!-- 消息部分 -->
<div class="messages-container">
    <div class="left-nav">
        <div class="demand-list">
            <!-- 动态添加需求列表 -->
        </div>
    </div>
    <div class="right-content">
        <div class="demand-details">
            <div class="demand-header">
                <div class="demand-name"></div>
            </div>
            <div class="comments-section">
                <div class="comment-count">
                    评论 <span class="total-comments">0</span>
                </div>
                <div class="comments-scroll-container">
                    <div class="message-list">
                        <!-- 评论将动态添加到这里 -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 修改密码界面 -->
<div class="change-password-container" style="display: none">
    <div class="change-password-form">
        <div>
            <label for="user-contact-display">手机号/邮箱</label>
            <input
                    type="text"
                    id="user-contact-display"
                    disabled
                    value="已登录的手机号或邮箱"
            />
        </div>
        <div class="verification-container">
            <input type="text" id="verification-code" placeholder="验证码" />
            <button id="get-verification-code">获取</button>
        </div>
        <div>
            <input type="password" id="new-password" placeholder="新密码" />
        </div>
        <div>
            <input
                    type="password"
                    id="confirm-password"
                    placeholder="确认新密码"
            />
        </div>
        <div>
            <button id="confirm-change-password">确认修改</button>
        </div>
        <div>
            <button id="return-to-user-info">返回</button>
        </div>
    </div>
</div>

<!-- 通知框 -->
<div class="notification">
    <span class="icon">✓</span>
    <span class="message"></span>
</div>

<script th:inline="javascript">
    // 获取Thymeleaf变量
    const userId = /*[[${userId}]]*/ null;
    const userEmail = /*[[${userEmail}]]*/ null;
</script>
<script src="/test/publisher.js"></script>
</body>
</html>
